<script>
function Register()
	{
		var credencials=new Object();
		credencials.module="Workspace.CreateWorkspace";
		credencials.description=$("Description").getValue();
		credencials.name=$("Name").getValue();
		
		new Ajax.Request('Model.php', {
			method: 'post',
			parameters: credencials,
			onSuccess: function(transport){
				var JSONtext = transport.responseText;
				var JSONobject = JSON.parse(JSONtext);
				if(JSONobject['result']==1)
					location="index.php";
				else
					$("warning").update(JSONobject['error']);
			},
			onFailure: function(){
				$("warning").update("Could not connect to server");
			}
		})

	} 

</Script>
